/*
 * npc.h
 */

#ifndef NPC_H_
#define NPC_H_

#include <agent/unit.h>

/*
struct npc {
    unit u;
    unsigned int dfo;
    struct npc *next;
    struct npc *previous;
};
*/

/*
 * Creates a new NPC with the given attributes at the given location.
 */
unit * npc_create( unsigned long x, unsigned long y, unsigned long z,
    const char *name, void *stats );

/*
 * Returns the NPC ID number of the last created NPC.
 */
int npc_last_id();

/*
 * Returns the unit with the given unit ID.
 */
unit * npc_get( int id );

/*
 * Returns the next (or first if this is the first time calling this function
 * or npc_list_reset() has been called) NPC in the NPC list. This
 * function is single-threaded and is not a true iterator, therefor it is
 * advised that npc_list_reset() is called before any invocation of
 * this function and that all work that needs to be done over this list is done
 * in a timely manner so as to not risk getting the iterator reset before all
 * work is done. Will return NULL when the list is exhausted until
 * npc_list_reset() is called.
 *
 * TL;DR version: Don't use this function.
 */
unit * npc_next();

/*
 * Resets the NPC list iterator.
 */
void npc_list_reset();

#endif
